Skip to content

Conversation

@elliottcarlson
Copy link
Contributor

@elliottcarlson elliottcarlson commented Jul 19, 2025

Problem

The @prettier/plugin-xml plugin in Prettier 3.6.0+ incorrectly identifies TypeScript files as XML, causing parsing errors during the post-install formatting step.

Error details:

  • Errors are emitted during the npx prettier --write post-install step.
  • Files affected: scripts/lint.ts, src/bundleEntry.ts, src/main.ts
  • Error: `SyntaxError: Expecting token of type --> OPEN <-- but found --> ...
  • Root cause: XML plugin attempting to parse TypeScript files

Solution

Add explicit TypeScript parser configuration in prettier.config.mjs overrides to ensure .ts files are correctly identified and parsed.

Testing

  • npx isaacscript@latest init completes successfully
  • ✅ Post-install npx prettier --write runs without errors
  • ✅ All TypeScript files format correctly
  • ✅ XML formatting remains unaffected

Impact

Fixes broken initialization flow for new projects using the latest Prettier version while maintaining compatibility with all existing plugins.

@Zamiell Zamiell merged commit d265079 into IsaacScript:main Jul 19, 2025
23 checks passed
@Zamiell
Copy link
Member

Zamiell commented Jul 19, 2025

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants